package com.qf.im.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.qf.im.base.BaseEntity;
import jakarta.validation.constraints.Email;
import jakarta.validation.constraints.NotBlank;
import lombok.Data;
import lombok.experimental.Accessors;
import org.hibernate.validator.constraints.Length;

import java.io.Serializable;

/**
 * 用户表(User)表实体类
 *
 * @author makejava
 * @since 2023-10-25 10:20:37
 */
@Data
@Accessors(chain = true)
public class User extends BaseEntity implements Serializable {
    //主键
    @TableId(type = IdType.AUTO)
    private Integer id;
    //账号
    @NotBlank(message = "账号不能为空！")
    @Length(max = 20, message = "账号长度不能超过{max}")
    private String username;
    //密码
    @NotBlank(message = "密码不能为空！")
    private String password;
    //邮箱
    @NotBlank(message = "邮箱不能为空！")
    @Email(message = "邮箱格式不合法")
    private String email;
    //头像
    private String header;
    //昵称
    private String nickname;
    //昵称的拼音
    private String nickpinyin;
}

